#include "deepinfor.h"

DeepInfor* DeepInfor::_instance=nullptr;

DeepInfor* DeepInfor::GetInstance(QObject* parent){
    if(DeepInfor::_instance==nullptr)
        DeepInfor::_instance=new DeepInfor(parent);
    return DeepInfor::_instance;
}

DeepInfor::~DeepInfor(){

}

void DeepInfor::SubmitInfor(Yzty::ITEMCODE mcode,QVector<Yzty::BaceInfor*>& infors){
    std::lock_guard<std::mutex> glock(this->_mutex);
    this->_infors[mcode]=std::move(infors);
}

const QVector<Yzty::BaceInfor*>& DeepInfor::GetItemInfor(Yzty::ITEMCODE icode){
    std::lock_guard<std::mutex> glock(this->_mutex);
    return this->_infors[icode];
}

DeepInfor::DeepInfor(QObject* parent):QObject (parent){

}
